package com.yincheng.oes.business.franchisee;

import java.util.List;

import org.apache.commons.lang3.tuple.Pair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yincheng.oes.business.util.Tools;

@Controller
@RequestMapping("/franchiseeList")
public class FranchiseeListController {
    @Autowired
    private FranchiseeListService franchiseeListService;

    @RequestMapping(value = "/studentListPage.html", method = RequestMethod.GET)
    public String quesListPage(Model model) {
        return "business/franchisee/studentList";
    }

    /**
     * 根据参数获取试卷列表数据
     *
     * @param bean
     * @return
     */
    @RequestMapping(value = "/getList.json", method = RequestMethod.GET)
    @ResponseBody
    public String list(QueryParamBean bean) {
        Pair<Integer, List<QueryResultRow>> pair = franchiseeListService.getPaperListByParam(bean);
        return Tools.toEasyuiDataGrid(pair.getLeft(), pair.getRight());
    }
}
